<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Article extends Base
{
    //追加一个字段 结合访问器
    protected $appends = ['action'];
    //访问器
    public function getActionAttribute()
    {
        return $this->editBtn('admin.article.edit').$this->deleteBtn('admin.article.destroy');
    }
    public function getPicAttribute()
    {
        return config('url.domain').$this->attributes['pic'];
    }
}
